import { h } from 'vue'
import { Modal } from 'ant-design-vue'
import { DeleteOutlined } from '@ant-design/icons-vue'

export const showDeleteModal = (conversation, emit) => {
  Modal.confirm({
    centered: true,
    icon: h(DeleteOutlined, { style: { color: '#e02e2a' } }),
    title: '删除聊天？',
    content: h('div', { class: 'py-4' }, [
      '这会删除"',
      h('span', { class: 'text-base font-bold' }, conversation.label),
      '"这个会话吗？',
    ]),
    okText: '删除',
    cancelText: '取消',
    okButtonProps: {
      danger: true,
    },
    onOk: () => {
      emit('delete-conversation', conversation.key)
    },
  })
}